package com.zxc.pricing;

import com.zxc.enums.Fruit;

import java.util.Map;

/**
 * 基础价格计算实现
 */
public class BasicPriceCalculator implements PriceCalculator {
    @Override
    public double calculateTotal(Map<Fruit, Integer> fruits) {
        double total = 0;
        for (Map.Entry<Fruit, Integer> entry : fruits.entrySet()) {
            total += entry.getKey().getPrice() * entry.getValue();
        }
        return total;
    }
}
